#ifndef ADDRULEDIALOG_H
#define ADDRULEDIALOG_H

#include "../json/json.h"
#include <QIntValidator>
#include <QToolButton>
#include <QIcon>
#include <QPalette>
#include "ui_addruledialog.h"
#include "filterwidget.h"

using namespace Json;

class AddRuleDialog : public QDialog, public Ui::AddRuleDialog
{
	Q_OBJECT

	public:
		AddRuleDialog(QDialog *parent=0);
		void fillForm(Value rule,int ruleID);


		
	public slots:
		void accept();	
		void reject();
	private:
		QToolButton *tabAddButton;
		QToolButton *tabDelButton;
		QIcon tabAddIcon;
		QIcon tabDelIcon;
		int ruleID;


		FilterWidget *filterWidget;
		bool validateInput();
		void giveFeedback(QString feedback);
		QList <QWidget> filterTabs;
		void addNewFilterTab(Value filter);
	private slots:
		void addFilterButtonPressed();
		void delFilterButtonPressed();
	signals:
		void saveRule(Value,int);
		void rejectme();
};

#endif
